package com.aduerr.v1shouyin.mvp.activity;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.aduerr.v1shouyin.R;
import com.orhanobut.hawk.Hawk;

public class ShopInfoActivity extends AppCompatActivity {

    @BindView(R.id.img_back)
    ImageView imgBack;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_right)
    TextView tvRight;
    @BindView(R.id.rl_title)
    RelativeLayout rlTitle;
    @BindView(R.id.tv_companyname)
    TextView tvCompanyname;
    @BindView(R.id.tv_shopname)
    TextView tvSShopname;
    @BindView(R.id.tv_leval)
    TextView tvLeval;
    @BindView(R.id.tv_sellername)
    TextView tv_sellername;
    @BindView(R.id.yinlainzhanghu)
    TextView yinlainzhanghu;
    @BindView(R.id.kaihuhang)
    TextView kaihuhang;
    @BindView(R.id.cardnumber)
    TextView cardnumber;
    @BindView(R.id.tv_agenname)
    TextView tvAgenname;
    @BindView(R.id.tv_phone)
    TextView tvPhone;
    @BindView(R.id.ll_bank_info)
    LinearLayout llBankInfo;
    @BindView(R.id.ll_agent_info)
    LinearLayout llAgentInfo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shop_info);
        ButterKnife.bind(this);
        initUI();
    }

    private void initUI() {
        tvTitle.setText("商户信息");

        String level = Hawk.get("level");
        if(level.equals("收银员")) {
            llBankInfo.setVisibility(View.GONE);
            llAgentInfo.setVisibility(View.GONE);
        } else {
            llBankInfo.setVisibility(View.VISIBLE);
            llAgentInfo.setVisibility(View.VISIBLE);
        }
        tvCompanyname.setText(Hawk.get("company"));
        tvSShopname.setText(Hawk.get("shopname"));
        tvLeval.setText(Hawk.get("leval"));
        tv_sellername.setText(Hawk.get("sellername"));
        yinlainzhanghu.setText(Hawk.get("accountname"));
        kaihuhang.setText(Hawk.get("BankPermitInfo"));
        cardnumber.setText(Hawk.get("BankPermitAccount"));
        tvAgenname.setText(Hawk.get("agentcompany"));
        tvPhone.setText(Hawk.get("agenttel"));
    }

    @OnClick(R.id.img_back)
    public void onViewClicked() {
        finish();
    }

    /*
    *         Hawk.put("sellername", userEntity.getDisplayname());//收银员姓名
        Hawk.put("shopname", userEntity.getShopname());

        Hawk.put("company", userEntity.getCompany());
        Hawk.put("leval", userEntity.getLevel());
        Hawk.put("accountname", userEntity.getAccountName());
        Hawk.put("BankPermitInfo", userEntity.getBankPermitInfo());
        Hawk.put("BankPermitAccount", userEntity.getBankPermitAccount());
        Hawk.put("agentcompany", userEntity.getAgentcompany());
        Hawk.put("phone", userEntity.getPhone());
    *
    *
    * */
}
